#include <iostream>
#include <vector>
using namespace std;

int BeatBoss(int a, vector<int> b)
{
    int c = a;
    for(int i = 0; i < b.size(); ++i){
        if(b[i] <= c)
            c += b[i];
        else{  // b[i] > a
            // 求最大公约数
            int gmd = c;   
            int bi = b[i], temp = c;
            while(bi % temp){
                gmd = bi % temp;
                bi = temp;
                temp = gmd;
            }
            c += gmd;
        }
    }
    return c;
}

int main()
{
    int n, a;  // 怪物n个，初始能力值a
    while(cin >> n >> a){
        if(n < 1 || n > 100000)
            continue;
        vector<int> boss(n+1);
        for(int i = 0; i < n; ++i){
            cin >> boss[i];
        }
        cout << BeatBoss(a, boss) << endl;
    }
    
}